// 消息相关API接口
import request from '../request'

export default {
  // 获取消息列表
  getMessageList(params) {
    return request.get('/message/list', params)
  },
  
  // 获取消息详情
  getMessageDetail(id) {
    return request.get(`/message/${id}`)
  },
  
  // 发送消息
  sendMessage(data) {
    return request.post('/message/send', data)
  },
  
  // 删除消息
  deleteMessage(id) {
    return request.delete(`/message/${id}`)
  },
  
  // 标记消息为已读
  markAsRead(id) {
    return request.put(`/message/${id}/read`)
  },
  
  // 批量标记为已读
  batchMarkAsRead(ids) {
    return request.put('/message/batch-read', { ids })
  },
  
  // 获取未读消息数量
  getUnreadCount() {
    return request.get('/message/unread-count')
  },
  
  // 获取消息统计
  getMessageStats(params) {
    return request.get('/message/stats', params)
  },
  
  // 获取消息类型
  getMessageTypes() {
    return request.get('/message/types')
  },
  
  // 获取系统通知
  getSystemNotifications(params) {
    return request.get('/message/system', params)
  },
  
  // 获取任务通知
  getTaskNotifications(params) {
    return request.get('/message/task', params)
  },
  
  // 获取库存预警消息
  getInventoryWarnings(params) {
    return request.get('/message/inventory-warnings', params)
  },
  
  // 获取操作日志
  getOperationLogs(params) {
    return request.get('/message/operation-logs', params)
  },
  
  // 清空消息
  clearMessages(type) {
    return request.delete('/message/clear', { type })
  },
  
  // 设置消息推送
  setMessagePush(data) {
    return request.put('/message/push-settings', data)
  },
  
  // 获取消息推送设置
  getMessagePushSettings() {
    return request.get('/message/push-settings')
  },
  
  // 获取消息模板
  getMessageTemplates() {
    return request.get('/message/templates')
  },
  
  // 发送系统广播
  sendBroadcast(data) {
    return request.post('/message/broadcast', data)
  },
  
  // 获取消息历史
  getMessageHistory(params) {
    return request.get('/message/history', params)
  }
} 